import React, { Component } from 'react'
export class Header extends Component {   
  render() {
      const {list,active,change}=this.props
    return (
      <div className='tab'>
          <ul>
              {list.length   ? list.map((item,index)=>{
                  return <li key={index} className={active===index ? 'on' :''} 
                  onClick={()=>{
                      change(index)

                  }}>{item.title}</li>
              }) :'还没有数据'  }
          </ul>
      </div>
    )
  }
}

export default Header